﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DigitalGenetics
{
    public class Metric
    {
        public int Count { get; set; }
        public int Value { get; set; }
        public double Percent { get; internal set; }

        public Metric()
        {
            Count = 0;
            Value = 0;
        }

        public void MakePercent(int total)
        {
            Percent = Value * 100.0d / total;
        }

        public override string ToString()
        {
            return string.Format("{0:F3}%, {1},", Percent, Value);
                //base.ToString();
        }
    }

    public class Metrics
    {
        public String Name { get; set; }
        public Metric Total { get; set; }
        public Metric TotalCross { get; set; }
        public Metric S16metric { get; set; }
        public Metric S4metric { get; set; }
        public Metric S1metric { get; set; }
        public Metric S16metricCross { get; set; }
        public Metric S4metricCross { get; set; }
        public Metric S1metricCross { get; set; }
        public Metric F1metric { get; set; }

        public Metrics()
        {
            Total = new Metric();
            TotalCross = new Metric();
            S16metric = new Metric();
            S4metric = new Metric();
            S1metric = new Metric();
            S16metricCross = new Metric();
            S4metricCross = new Metric();
            S1metricCross = new Metric();
            F1metric = new Metric();
        }

        public void MakePercent()
        {
            int total = Total.Value;
            Total.MakePercent(total);
            S16metric.MakePercent(total);
            S4metric.MakePercent(total);
            S1metric.MakePercent(total);
            S16metricCross.MakePercent(total);
            S4metricCross.MakePercent(total);
            S1metricCross.MakePercent(total);
            F1metric.MakePercent(total);
        }
    }
}
